function showCustomAlert(msg, sty) {
  // 创建提示框元素
  var customAlert = document.createElement("div");
  customAlert.className = "custom-alert"
  var icon = document.createElement("i")
  var message = document.createElement("i")
  if (sty) {
    icon.className = 'iconfont icon-right-1-copy'
    customAlert.style.backgroundColor = "#def5de"
    customAlert.style.color = "#09713a"

  } else if (!sty) {
    icon.className = 'iconfont icon-cuowuguanbiquxiao-yuankuang'
    customAlert.style.backgroundColor = "#ffeded"
    customAlert.style.color = "#ff717c"
  }
  // 创建提示文本
  message.innerHTML = msg
  // 将提示文本添加到提示框中
  customAlert.appendChild(icon)
  customAlert.appendChild(message)

  // 将提示框添加到页面中
  document.body.appendChild(customAlert)
  //一定时间后自动关闭提示框
  setTimeout(function () {
    document.body.removeChild(customAlert)
  }, 1500); // 1500毫秒（1.5秒）后关闭提示框
}
// 确认框
function customConfirm(msg,callback) {
    const confirmBox = document.createElement('div')
    confirmBox.classList.add('confirm-box')
    confirmBox.innerHTML = `
  <p>${msg}</p>
  <button id="confirmYes">确定</button>
  <button id="confirmNo">取消</button>
`
    document.body.appendChild(confirmBox)
    // 确认按钮点击事件
    const confirmYesBtn = confirmBox.querySelector('#confirmYes');
    confirmYesBtn.addEventListener('click', () => {
      document.body.removeChild(confirmBox)
      callback(true)
    })
    // 取消按钮点击事件
    const confirmNoBtn = confirmBox.querySelector('#confirmNo');
    confirmNoBtn.addEventListener('click', () => {
      document.body.removeChild(confirmBox)
      callback(false)
    })
}